package Door;

import java.util.Random;

/**
 * @Author czl
 * @Date 2024-03-14
 */
public class Thief {
    public void stael(Switch s){
        s.Kai();

        if (s instanceof RingingBell){

            Switch f = new SecurityDoor();
            ((SecurityDoor) f).FangDao();

        }

        Random r = new Random();
        int randomNumber = r.nextInt(11);

        if (randomNumber > 5){
            System.out.println("偷盗成功");
        }else {
            System.out.println("偷盗失败");
        }
    }
}
